﻿// 项目：	Guan.CMS.Data - Guan.CMS
// 文件名：	MediaConfiguration.cs
// 
// 修改时间：2013-03-09 9:28
// 修改人：	Cooclsee

using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Guan.CMS.Model.Entities;

namespace Guan.CMS.Data.Configurations
{
    public class MediaConfiguration : EntityTypeConfiguration<Media>
    {
         public MediaConfiguration()
         {
             ToTable("Media");
             HasKey(c => c.Id);
             Property(c => c.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
             Property(c => c.Name).HasMaxLength(1024).IsRequired();
             Property(c => c.ExtName).HasMaxLength(50);
             Property(c => c.Path).HasMaxLength(2048);
             //Property(c => c.Size)
         }
    }
}